<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>get time</title>
<script language="JavaScript" type="text/javascript" src="./jquery.min.js"></script>

<script type="text/javascript">
var request_count = 0;
var timing_count = 0;

$(function(){
	timing();
	get_time();
});

//获取服务器时间
function get_time() {
	$('.time_show').load('./time.php', {a:1}, function(){
		request_count++;
		$('.request_count').html(request_count);
		get_time();
	});
}

//计时
function timing() {
	//时间(0.01秒)
	timing_count += 1;
	//每秒请求
	var rps = Math.round(request_count/timing_count*100*10)/10;
	//每次请求
	var ro = 0;
	rps == 0 ? ro = '…' : ro = Math.round(timing_count*10/request_count);
	
	//显示
	$('.timing_count').html(timing_count/100);
	$('.rps').html(rps);
	$('.ro').html(ro);
	
	//递归
	setTimeout('timing()', 10);
}
</script>
<style type="text/css">
body{
	font-size:14px;
}
.time_show{
	color:#FF0000;
	font-weight:bold;
}
table{
	background:#0099CC;
}
td{
	background:#FFFFFF;
	padding:5px;
}
</style>

</head>

<body>

<div class="time_show">
Load…
</div>
<hr />
<table cellspacing="1">
	<tr>
		<td width="80">请求数</td>
		<td width="200"><span class="request_count">Loading…</span></td>
	</tr>
	<tr>
		<td>时间</td>
		<td><span class="timing_count">Loading…</span> s</td>
	</tr>
	<tr>
		<td>每秒请求</td>
		<td><span class="rps">Loading…</span></td>
	</tr>
	<tr>
		<td>每次请求</td>
		<td><span class="ro">Loading…</span> ms</td>
	</tr>
</table>

<hr />
请求曲线、失败请求、停止控制 is developing…
</body>
</html>